/*
 * @lc app=leetcode id=458 lang=cpp
 *
 * [458] Poor Pigs
 */

// @lc code=start
class Solution {
public:
    int poorPigs(int buckets, int minutesToDie, int minutesToTest) {
        if (buckets == 1) {
            return 0;
        }
        int n = minutesToTest / minutesToDie + 1;
        int ans = 1;
        int s = n;
        while (s < buckets) {
            ans++;
            s *= n;
        }
        return ans;
    }
};
// @lc code=end

